package com.atwei.mango.business.hello.service.impl;

import com.atwei.mango.business.hello.entity.Hello;
import com.atwei.mango.business.hello.mapper.HelloMapper;
import com.atwei.mango.business.hello.service.HelloService;
//import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

;

/**
 * @author liuwei
 * @date 2021/10/16 19:37
 */
@Log4j2
@Service
//@DS("slave")
public class HelloSlaveServiceImpl extends ServiceImpl<HelloMapper,Hello> implements HelloService {


    @Override
    public void testMybatis() {
        Hello hello = baseMapper.getByIdCustom(1);
        log.info(hello.toString());
    }

    @Override
    public void testMybatisPlus() {
        Page<Hello> page = new Page<>(1,10);
        baseMapper.selectPageCustom(page);
        log.info(page.getRecords().get(0));

    }

    @Override
    public void testSqlWrapperCustom() {

    }
}
